package org.example.dynamic.util;

/**
 * 响应码、提示信息
 */
public enum ResultCode {
    /**
     * 错误码
     */
    SUCCESS(0, "操作成功"),
    FAILED(401, "系统错误"),
    BAD_PARAMETER(402, "参数不正确!"),
    REPETITIVE_SUBMISSION(405, "请勿重复提交数据！"),
    USERNAME_PASSWORD_ERROR(601, "用户名或密码错误！"),
    USER_NOT_REGISTER_ERROR(602, "该手机号未注册"),
    LOGIN_TYPE_ERROR(603, "错误的登录方式！"),
    CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
    UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式"),
    INVALID_TOKEN(1004,"无效的token"),
    NO_PERMISSION(1005,"无权限访问！"),
    BAD_SMS_CONFIG(1006,"尚未配置短信服务，请联系系统运维人员维护相关配置文件!"),
    CHECK_CODE_ERROR(5005, "验证码不一致！"),
    CHECK_CODE_EXPIRE(5006, "验证码已失效！"),
    CAPTCHA_CODE_ERROR(5009, "图形验证码不一致！"),
    CAPTCHA_CODE_EXPIRE(5010, "图形验证码已失效！"),
    NAME_EXIST_EXCEPTION(5007, "账号已被注册"),
    PHONE_EXIST_EXCEPTION(5008, "手机号已被注册"),
    FILE_TYPE_EXCEPTION(6001, "文件类型不正确!"),
    FILE_UPLOAD_EXCEPTION(6002, "云存储调用错误，文件上传失败!"),
    FILE_READ_EXCEPTION(6003, "文件读取错误，请检查文件后重新上传!"),

    HELM_EXEC_EXCEPTION(7001, "helm命令，执行出错!"),
    TEMPLATE_READ_EXCEPTION(7002, "template文件获取失败!"),
    CREATE_NAMESPACE_EXCEPTION(7003, "命名空间构建失败!"),
    YAML_DEPLOY_EXCEPTION(7004, "Yaml部署失败!"),
    YAML_DELETE_EXCEPTION(7005, "Yaml删除失败!"),
    DATA_DELETE_EXCEPTION(400, "数据删除失败!"),
    DATA_SELECT_EXCEPTION(400, "数据查询失败!"),
    DATA_UPDATE_EXCEPTION(400, "数据修改失败!"),
    DATA_INSERT_EXCEPTION(400, "数据添加失败!"),
   ;


    private final Integer code;

    private final String msg;

    ResultCode(Integer code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
